package Review2;

public class Test17 {
   public ListNode mergeList(ListNode head1,ListNode head2){
	   if(head1==null){
		   return head2;
	   }
	   if(head2==null){
		   return head1;
	   }
	   ListNode head;
	   if(head1.value < head2.value){
		   head=head1;
		   head.next=mergeList(head1.next, head2);
	   } else{
		   head=head2;
		   head.next=mergeList(head1, head2.next);
	   }
	   return head;
   }
}
